<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Logger formatting test</title>	
		
		<link type="text/css" rel="stylesheet" href="../dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css"></link>
		<link type="text/css" rel="stylesheet" href="../src/main.css"></link>
		<link type="text/css" rel="stylesheet" href="../src/logs.css"></link>
		
		<script type="text/javascript" src="../src/utils.js"></script>
		<script type="text/javascript" src="../src/main.js"></script>
		
		<style>
			/*
			.hidden { display:none; }
			.closed { display:none; }
			*/
		</style>
				
		<script type="text/javascript">
			
			function _onload()
			{
				exemple1 = 
				{
					id:"1",
					
					message:{
								type:"com.package.CustomType",
								atype:"Object",
								value:{
										subobj :{
													type:"flash.geom.Point",
													atype:"Object",
													value:	{
																x:	{	
																		type:"Number",
																		atype:"Number",
																		value:20
																 	},
																y:	{	
																		type:"Number",
																		atype:"Number",
																		value:120
																 	}	
															}
												},
										string:	{	
													type:"String",
													atype:"String",
													value:"hello world 0xff00ff, couleur non parsé baabaa"
											 	},
										source:	{	
													type:"Source",
													atype:"Source",
													value:"as3:package somepackage \n{"+
																"\n\timport flash.display.Sprite;"+
																"\n\timport flash.display.IDisplayable;\n"+
																"\n\t/**"+
																"\n\t * Un commentaire de test"+
																"\n\t */"+
																"\n\tpublic class Test extends Sprite implements IDisplayable "+
																"\n\t{"+
																"\n\t\tpublic function Test( param : String = \"\", param2 : Number = 10, ... rest ){}" +
																"\n\t}\n}"
											 	},											
										number:	{
													type:"Number",
													atype:"Number",
													value:50
												},
										boolean:{
													type:"Boolean",
													atype:"Boolean",
													value:false
										},
										array:	{
													type:"Array",
													atype:"Array",
													value:[
															{
																type:"String",
																atype:"String",
																value:"hello world #ff0000"
															},
															{
																type:"XML",
																atype:"XML",
																value:"<node attribute='attribute content'>\n\tnode content\n</node>"
															}
													]
												}										 
									  }
							},
			
					details:{
								time:Date(),
								level:DEBUG,
								file:"logger-test.html",
								clazz:"window",
								func:"onload",
								line:"121"
							}
				};
				
				exemple2 = 
				{
					id:"1",				
					message:{
								type:"XMLList",
								atype:"XML",
								value:"<node>foo</node>\n<node>foo</node>\n<node>foo</node>"
							},		
					details:{
								time:Date(),
								level:INFO
							}
				};
				exemple3 = 
				{
					id:"1",				
					message:{
								type:"String",
								atype:"String",
								value:"exemple 3"
							},		
					details:{
								time:Date(),
								level:WARN
							}
				};
				exemple4 = 
				{
					id:"1",				
					message:{
								type:"String",
								atype:"String",
								value:"exemple 4"
							},		
					details:{
								time:Date(),
								level:ERROR
							}
				};
				exemple5 = 
				{
					id:"1",				
					message:{
								type:"String",
								atype:"String",
								value:"exemple 5"
							},		
					details:{
								time:Date(),
								level:FATAL
							}
				};
				
				/*
				eval ( "o = {string:'hello'," +
							"number:50," +
							"bool:false," +
							"date:Date()," +
							"array:['foo', DEBUG, false]," +
							"subobj: { foo:'sub hello' } };" );
				
				alert( o.string );
				alert( o.number );
				alert( o.bool );
				alert( o.date );
				alert( o.array );
				alert( o.subobj.foo );
				*/
				
				formatterManager = new ul.Format.FormatManager();
	
				s = formatterManager.getFormatter( ul.Format.LOG ).format( exemple1 );
				s += formatterManager.getFormatter( ul.Format.LOG ).format( exemple2 );
				s += formatterManager.getFormatter( ul.Format.LOG ).format( exemple3 );
				s += formatterManager.getFormatter( ul.Format.LOG ).format( exemple4 );
				s += formatterManager.getFormatter( ul.Format.LOG ).format( exemple5 );
				
				var el = $ ( "main" );
				el.innerHTML = s;
				
// 				//ul.Filter.filter( el, ul.Filter.EQUALS, DEBUG );
				
				dp.SyntaxHighlighter.ClipboardSwf = '/flash/clipboard.swf';
				dp.SyntaxHighlighter.HighlightAll('code');
				
				
			}
		</script>
			
	</head>
	<body onload="_onload();">
		<div id="main"></div>
	</body>
</html>
